package org.example.implaoptwoway.extendAbstratAdvisor;

import org.aopalliance.aop.Advice;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.AbstractPointcutAdvisor;
import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
import org.springframework.stereotype.Component;

@Component
public class OrderAdvisor extends AbstractPointcutAdvisor {
    Advice advice;
    Pointcut pointcut;

    public OrderAdvisor(){
        this.advice=new OrderDaoAdvice();
        AnnotationMatchingPointcut pointcut = AnnotationMatchingPointcut.forMethodAnnotation(MyAnnotation.class);
       this.pointcut=pointcut;
    }
    @Override
    public Pointcut getPointcut() {
        return pointcut;
    }

    @Override
    public Advice getAdvice() {
        return advice;
    }
}
